package com.echoplots.admin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
/**
 * 
 * @author Administrator
 *https://www.cnblogs.com/huanchupkblog/p/10563629.html
 */
@EnableAdminServer
@EnableDiscoveryClient
@Configuration
@EnableAutoConfiguration
public class EchoplotsSpringBootEurekaAdminServerApplication {

	public static void main(String[] args) {
		SpringApplication.run(EchoplotsSpringBootEurekaAdminServerApplication.class, args);
	}
	@Configuration
	public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
	        @Override
	        protected void configure(HttpSecurity http) throws Exception {
	            http.authorizeRequests().anyRequest().permitAll()  
	                .and().csrf().disable();
	        }
	  }
}
